<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<style>
.answer ul {list-style: none}
</style>
<div class="middle padtop10 myclear">
	<div class="page-content">
		
		<!-- bread crumb -->
		<p id="bread-crumb">
			<a href="<?php echo base_url();?>">
				<?php echo $lang['home']?>
			</a>
			<a href="<?php echo site_url('faqs');?>">
				<?php echo $lang['faqs'];?>
			</a>
			<?php echo $lang['add_category'];?>
		</p>
		<!-- end bread crumb -->
		<h3>
			<?php echo $lang['add_category'];?>
		</h3>
		<br style="clear:both;" />
		<form action="<?php echo site_url('faqs/insertCategory');?>" onsubmit="return checkFaqSubmit();" method="post">
		<table width="100%" style="border-spacing: 5px">
			<tr>
				<td width="50px">
					<?php echo $lang['level']?>:
				</td>
				<td>
					<select name="level" style="width:200px">
						<option value="0"><?php echo $lang['default'];?></option>
						<?php foreach ($lstCat as $item){?>
						<option value="<?php echo $item->cat_id;?>" <?php if($item->parent_id > 0) echo 'disabled="disabled"';?>>
							<?php echo ($item->parent_id > 0 ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|_' : '').$item->name;?>
						</option>
						<?php }?>
					</select>
				</td>
			</tr>
			<tr>
				<td>
					<?php echo $lang['name'];?>:
				</td>
				<td>
					<input type="text" id="catname" name="catname" value="" size="35" />
				</td>
			</tr>
			<tr>
				<td></td>
				<td><br />
					<input type="submit" value="<?php echo $lang['save'];?>" />&nbsp;
					<input type="button" value="<?php echo $lang['cancel'];?>" onclick="window.location.href='<?php echo site_url('faqs/Categories');?>';" />
				</td>
			</tr>
		</table>
		</form>
	</div>
</div><br /><br /><br /><br />
<script type="text/javascript">
function checkFaqSubmit()
{
	if($('#catname').val() == '')
	{
		alert('<?php echo $lang['enter_name'];?>');
		return false;
	}
	return true;
}
</script>